RPC vulns and services reports resources and parents (service only)#21305
Merged
adfoster-r7 merged 3 commits intoMay 15, 2026
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
Adds richer reporting metadata to the RPC database endpoints to align with updated service/vulnerability reporting, specifically exposing resource data and service parent relationships to RPC consumers.
Changes:
db.services: refactors service serialization into a helper and addsresource+ recursiveparents.db.vulns: addsresourceto each returned vulnerability.
73697ef to
c07df96
Compare
adfoster-r7
reviewed
May 15, 2026
| # @param recursion_count [Integer] Current recursion iteration count | ||
| # @return [Hash] Serialized service data. | ||
| def process_service(mdm_service, recursion_count = 0) | ||
| return { error: :recursion_limit_reached } unless recursion_count >= 0 && recursion_count < 6 |
Contributor
There was a problem hiding this comment.
Can we bump this to 10, and raise an exception here for the depth issue instead? 👀
Not a blocker, I believe we can avoid the n+1 query issues here with a native SQL query
fe848ad to
b327f29
Compare
adfoster-r7
approved these changes
May 15, 2026
Contributor
Author
Release NotesUpdates the services RPC endpoint to additionally report the resource and parent services fields. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #21250
This PR adds the reporting of
resourcefor both thedb.vulnsanddb.servicesRPC calls. It also adds theparentsfield to the services only.Tested in Pro, no changes/impact.
Before
db.vulns
no resources
db.services
No resources and no parents
After
db.vulns
db.services
JSON RPC
This also works for JSON RPC:
=> Vulns
{ "port": 445, "proto": "tcp", "time": 1776246892, "host": "x", "name": "ESC15", "refs": "URL-https://trustedsec.com/blog/ekuwu-not-just-another-ad-cs-esc", "resource": { "ldap_dn": "CN=ESC15,CN=Certificate Templates,CN=Public Key Services,CN=Services,CN=Configuration,DC=ad,DC=pro,DC=local", "template_name": "ESC15" } },=> services
{ "host": "x", "created_at": 1776246677, "updated_at": 1776246677, "port": 445, "proto": "tcp", "state": "open", "name": "icertpassage", "info": "", "resource": { "dcerpc": { "pipe": "cert" } }, "parents": [ { "host": "x", "created_at": 1776246676, "updated_at": 1776246677, "port": 445, "proto": "tcp", "state": "open", "name": "dcerpc", "info": "", "resource": { "smb": { "share": "IPC$" } }, "parents": [ { "host": "x", "created_at": 1776246676, "updated_at": 1776246676, "port": 445, "proto": "tcp", "state": "open", "name": "smb", "info": "", "resource": {}, "parents": [] } ] } ] },Verification
List the steps needed to make sure this thing works
msfconsoleload msgrpcrpc.call("db.services", {})rpc.call("db.vulns", {})